cd "~\Desktop\Projects\COVID\Analysis"
set seed 662607004

import excel "~\Desktop\Projects\COVID\Analysis\Wave 1.xlsx", sheet("Sheet1") firstrow clear

rename NeighborhoodInfluencer w1q1
label variable w1q1 "Currently, how often do you interact with your neighbors?"
replace w1q1="1" if w1q1=="Never"
replace w1q1="2" if w1q1=="Rarely"
replace w1q1="3" if w1q1=="Occasionally"
replace w1q1="4" if w1q1=="Frequently"
replace w1q1="99" if w1q1=="Unsure "

rename UninformedCOVIDThreat17 w1q2
label variable w1q2 "On a scale of 1 - 7, with 1 being the least severe and 7 being the most severe, how big of a threat to peoplesâ€™ health is COVID-19 in Georgia?"
replace w1q2="0" if w1q2=="COVID-19 is not a threat in Georgia"
replace w1q2="99" if w1q2=="Unsure "

rename COVIDExaggeration w1q3
label variable w1q3 "Do you think the threat of COVID-19 is being exaggerated or downplayed?"
replace w1q3="1" if w1q3=="Very downplayed"
replace w1q3="2" if w1q3=="Somewhat downplayed"
replace w1q3="3" if w1q3=="Neither exaggerated nor downplayed"
replace w1q3="4" if w1q3=="Somewhat exaggerated"
replace w1q3="5" if w1q3=="Very exaggerated"
replace w1q3="99" if w1q3=="Unsure "

rename COVIDComplicationsConcern w1q4
label variable w1q4 "How concerned are you that you or an immediate family member will get serious complications and or be hospitalized due to COVID-19?"
replace w1q4="1" if w1q4=="Very unconcerned"
replace w1q4="2" if w1q4=="Somewhat unconcerned"
replace w1q4="3" if w1q4=="Neither concerned nor unconcerned"
replace w1q4="4" if w1q4=="Somewhat concerned"
replace w1q4="5" if w1q4=="Very concerned"
replace w1q4="99" if w1q4=="Unsure "

rename COVIDHandling w1q5 
label variable w1q5 "Which of the following statements is closest to how you think Georgia should handle the COVID-19 pandemic?"
replace w1q5="1" if w1q5=="No public health measures are necessary"
replace w1q5="2" if w1q5=="All public health measures to keep people safe should be voluntary"
replace w1q5="3" if w1q5=="Some public health measures to keep people safe should be voluntary and someÂ â€“ such as wearing masks and social distancing in publicÂ â€“ should be mandatory"
replace w1q5="4" if w1q5=="All public health measures to keep people safe should be mandatory"
replace w1q5="99" if w1q5=="Unsure "

rename DontWorryifStrongImmuneSys w1q6
label variable w1q6 "People with strong immune systems do not need to worry about COVID-19"
replace w1q6="1" if w1q6=="Strongly disagree" 
replace w1q6="2" if w1q6=="Somewhat disagree"
replace w1q6="3" if w1q6=="Neither agree nor disagree"
replace w1q6="4" if w1q6=="Somewhat agree"
replace w1q6="5" if w1q6=="Strongly agree"
replace w1q6="99" if w1q6=="Unsure"

rename SameasFlu w1q7
label variable w1q7 "COVID-19 poses the same risk as the seasonal flu"
replace w1q7="1" if w1q7=="Strongly disagree" 
replace w1q7="2" if w1q7=="Somewhat disagree"
replace w1q7="3" if w1q7=="Neither agree nor disagree"
replace w1q7="4" if w1q7=="Somewhat agree"
replace w1q7="5" if w1q7=="Strongly agree"
replace w1q7="99" if w1q7=="Unsure"

rename COVIDVaccine w1q8 
label variable w1q8 "There will be a widely available vaccine for COVID-19 by the end of the year"
replace w1q8="1" if w1q8=="Strongly disagree" 
replace w1q8="2" if w1q8=="Somewhat disagree"
replace w1q8="3" if w1q8=="Neither agree nor disagree"
replace w1q8="4" if w1q8=="Somewhat agree"
replace w1q8="5" if w1q8=="Strongly agree"
replace w1q8="99" if w1q8=="Unsure"

rename DesiretoSociallyDistance w1q9
label variable w1q9 "During this pandemic, I wish people who are not a part of my household would stay at least six feet away from me"
replace w1q9="1" if w1q9=="Strongly disagree" 
replace w1q9="2" if w1q9=="Somewhat disagree"
replace w1q9="3" if w1q9=="Neither agree nor disagree"
replace w1q9="4" if w1q9=="Somewhat agree"
replace w1q9="5" if w1q9=="Strongly agree"
replace w1q9="99" if w1q9=="Unsure"

rename VaccineReaction w1q10
label variable w1q10 "Once a COVID-19 vaccine is available in the U.S., which of the following statements most closely matches what youâ€™ll do?"
replace w1q10="1" if w1q10=="I will not get the vaccine because COVID-19 is not a real danger"
replace w1q10="2" if w1q10=="I will get the vaccine eventually, but I’ll wait to make sure it is safe"
replace w1q10="3" if w1q10=="I will get the vaccine when I get around to it"
replace w1q10="4" if w1q10=="I will get the vaccine immediately"
replace w1q10="88" if w1q10=="I will not get the vaccine because I don’t think vaccines are safe in general"
replace w1q10="99" if w1q10=="Unsure "

rename FrequencyLargeGroupEvent w1q11
label variable w1q11 "In the past month, how many times have you attended a group event with more than 10 people in attendance, such as a religious gathering, party, funeral, wedding, sporting event, etc.?"
replace w1q11="1" if w1q11=="I have not attended a group event with more than 10 people in attendance in the past month"
replace w1q11="2" if w1q11=="1 - 2 times in the past month"
replace w1q11="3" if w1q11=="3 - 6 times in the past month"
replace w1q11="4" if w1q11=="7 - 10 times in the past month"
replace w1q11="5" if w1q11=="More than 10 times in the past month"
replace w1q11="99" if w1q11=="Unsure "

rename FrequencyMask w1q12
label variable w1q12 "When out in public and around people, how often do you wear a mask or face covering?"
replace w1q12="1" if w1q12=="Never"
replace w1q12="2" if w1q12=="Rarely"
replace w1q12="3" if w1q12=="Some of the time"
replace w1q12="4" if w1q12=="Most of the time"
replace w1q12="5" if w1q12=="Always"
replace w1q12="99" if w1q12=="Unsure "


// Responses to why people are not wearing masks

rename Otherpeopleintheareawereno NoMask1W1
rename Iwasconcernedaboutwhatother NoMask2W1
rename Masksareawkwarduncomfortable NoMask3W1
rename Maskscannotprotectmeorstop NoMask4W1
rename ThereislittleriskthatIcan NoMask5W1
rename MasksareunnecessarybecauseCO NoMask6W1
rename Idontcareabouttherisks NoMask7W1
rename Beingforcedtowearamaskviol NoMask8W1
rename Thegovernmentdoesntrequirem NoMask9W1
rename Iforgettobringamask NoMask10W1
rename Wearingamaskisagreaterthre NoMask11W1
rename Unsure NoMaskUnsureW1
rename Other NoMaskOtherW1

rename FrequencySocialDistance w1q14 
label variable w1q14 "When out in public and around people, how often do you socially distance by staying six or more feet away from others?"
replace w1q14="1" if w1q14=="Never"
replace w1q14="2" if w1q14=="Rarely"
replace w1q14="3" if w1q14=="Some of the time"
replace w1q14="4" if w1q14=="Most of the time"
replace w1q14="5" if w1q14=="Always"
replace w1q14="99" if w1q14=="Unsure "

// Responses to why people are not socially distancing

rename AA SocDis1W1
rename AB SocDis2W1
rename Sociallydistancingisawkwardu SocDis3W1
rename Sociallydistancingcannotprote SocDis4W1
rename AE SocDis5W1
rename Sociallydistancingisnotneces SocDis6W1
rename AG SocDis7W1
rename Beingforcedtosociallydistanc SocDis8W1
rename Thegovernmentdoesntrequires SocDis9W1
rename Iforgettosociallydistance SocDis10W1
rename AK SocDisUnsureW1
rename AL SocDisOtherW1

rename FrequencyEncourageMaskSoc w1q16
label variable w1q16 "How often do you ask or encourage your family or friends to wear a mask and/or stay six feet away from others for their own safety?"
replace w1q16="1" if w1q16=="Never"
replace w1q16="2" if w1q16=="Rarely"
replace w1q16="3" if w1q16=="Some of the time"
replace w1q16="4" if w1q16=="Most of the time"
replace w1q16="5" if w1q16=="Always"
replace w1q16="99" if w1q16=="Unsure "

rename HowManyinMasksSocialDista w1q17
label variable w1q17 "Generally, when you are in public, how many of the people around you are wearing masks and/or social distancing by staying at least six feet away from others?"
replace w1q17="1" if w1q17=="Practically no one"
replace w1q17="2" if w1q17=="Some people, but less than half"
replace w1q17="3" if w1q17=="Not everyone, but more than half"
replace w1q17="4" if w1q17=="Practically everyone"
replace w1q17="88" if w1q17=="I never go out"
replace w1q17="99" if w1q17=="Unsure "

rename ShoppingChange w1q18
label variable w1q18 "Which of the following statements most closely reflects how your shopping habits have changed due to COVID-19, if at all?"
replace w1q18="1" if w1q18=="I go to the store less often"
replace w1q18="2" if w1q18=="My shopping habits haven’t changed – I go to the store the same amount"
replace w1q18="3" if w1q18=="I go to the store more often"
replace w1q18="99" if w1q18=="Unsure "

// Responses to video
rename Seeingthathealthyyoungpeople VidResponse1W1
rename Hallucinationsamongpeoplewho  VidResponse2W1
rename Seeingthatpeoplewhodownplaye  VidResponse3W1
rename TheArmyGeneralsstatementsof  VidResponse4W1
rename Learningthatpeoplewhoworked  VidResponse5W1
rename Thedoctorsdescriptionofwhy  VidResponse6W1
rename Noneoftheabove  VidResponse7W1
rename AW  VidResponseUnsureW1
rename AX  VidResponseOtherW1

rename InformedCOVIDThreat17 w1q28
replace w1q28="0" if w1q28=="COVID-19 is not a health threat in general"
replace w1q28="99" if w1q28=="Unsure "

rename FamilyFriendCOVIDDiagnosis w1q29
label variable w1q29 "Do you believe you or someone in your household, a friend, or a coworker has been infected with COVID-19 at any time?"
replace w1q29="1" if w1q29=="No, I do not believe myself or an immediate family member has had COVID-19"
replace w1q29="2" if w1q29=="Yes, the symptoms were consistent with the virus but not confirmed by a test"
replace w1q29="3" if w1q29=="Yes, a medical test confirmed COVID-19"
replace w1q29="99" if w1q29=="Unsure "

rename EssentialWorkerinHousehold w1q22
label variable w1q22 "Are you or someone in your household considered an essential worker, such as a worker in the medical field, home care, manufacturing, the service industry, etc.?"
replace w1q22="1" if w1q22=="No"
replace w1q22="2" if w1q22=="Yes, someone in my household is"
replace w1q22="3" if w1q22=="Yes, I am"

rename MedicalResponsibility w1q23
label variable w1q23 "How many people, including yourself, do you have medical responsibility over such as children, a disabled or elderly relative, etc?"
replace w1q23="1" if w1q23=="1"
replace w1q23="2" if w1q23=="2"
replace w1q23="3" if w1q23=="3"
replace w1q23="4" if w1q23=="4"
replace w1q23="5" if w1q23=="More than 4"


//News Consumption

rename LocalTVnews NewsSource1
rename CNNcableTV NewsSource2
rename MSNBCcableTV NewsSource3
rename FOXNewscableTV NewsSource4
rename Radio NewsSource5
rename Facebook NewsSource6
rename Twitter NewsSource7
rename YouTube NewsSource8
rename Printandoronlinenewspapers NewsSource9
rename Otheronlinepublications NewsSource10
rename Friendsandfamily NewsSource11
rename IdontfollownewsrelatedtoC NewsSource12
rename BQ NewsSourceUnsure
rename BR NewsSourceOther


rename COVIDNewsConsumption w1q25 
label variable w1q25 "How often do you read, watch, or listen to news related to COVID-19?"
replace w1q25="1" if w1q25=="Once a month or less"
replace w1q25="2" if w1q25=="A few times a month"
replace w1q25="3" if w1q25=="Once a week"
replace w1q25="4" if w1q25=="Several times a week"
replace w1q25="5" if w1q25=="Once a day"
replace w1q25="6" if w1q25=="More than once a day"
replace w1q25="99" if w1q25=="Unsure "

rename CommunityGroupMembership w1q26
label variable w1q26 "Regardless of whether or not youâ€™re currently able to meet in person, are you an active member of a community organization such as a church group, a service organization, business organization, sports/recreation team, neighborhood association, or other similar group?"
replace w1q26="1" if w1q26=="No"
replace w1q26="2" if w1q26=="Yes"

gen test="."
replace test="1" if Group=="Test"
replace test="0" if Group=="Control"

rename Gender female
replace female="1" if female=="Female"
replace female="0" if female=="Male"
replace female="99" if female=="Other "

rename AgeRange age
replace age="1" if age=="18 - 34"
replace age="2" if age=="35 - 49"
replace age="3" if age=="50 - 64"
replace age="4" if age=="65 or older"

rename IncomebyResponse income4cat
replace income4cat="2" if income4cat=="$25,000 - $50,000"
replace income4cat="3" if income4cat=="$50,001 - $100,000"
replace income4cat="1" if income4cat=="Less than $25,000"
replace income4cat="4" if income4cat=="More than $100,000"

rename Income_Group income3cat
replace income3cat="1" if income3cat=="<$50k"
replace income3cat="2" if income3cat=="$50k-$99k"
replace income3cat="3" if income3cat=="$100k+"
replace income3cat="99" if income3cat=="Unknown"

rename Voter_Propensity voteProp
label variable voteProp "Voter Propensity"
replace voteProp="1" if voteProp=="Low"
replace voteProp="2" if voteProp=="Medium"
replace voteProp="3" if voteProp=="High"
replace voteProp="99" if voteProp=="Invalid Number. For input string: """

rename Education edu
replace edu="1" if edu=="High school or less"
replace edu="2" if edu=="Some college"
replace edu="3" if edu=="Bachelors degree or higher"
replace edu="99" if edu=="Unknown"

rename Marital_Status married
replace married="1" if married=="Married"
replace married="0" if married!="1"

rename PresenceOfChildrenCode kids
replace kids="0" if kids!="Yes"
replace kids="1" if kids=="Yes"

rename minute_diff minutes1

gen exclude1=0
replace exclude1=1 if test=="0" & minutes1<2  // 4 respondents 
replace exclude1=1 if test=="1" & minutes1<5  // 43 respondents

gen white=0
replace white=1 if Ethnicity=="White"
gen black=0
replace black=1 if Ethnicity=="Black"
gen asian=0
replace asian=1 if Ethnicity=="Asian"
gen hispanic=0
replace hispanic=1 if Ethnicity=="Hispanic/Latino"

gen wave=1
	
destring _all, replace

save "~\Desktop\Projects\COVID\Analysis\Wave 1 Prelim Data Final.dta", replace



////////////////////////////////////////////////////////////////////////////////

// Wave 2

import excel "~\Desktop\Projects\COVID\Analysis\Wave 2 Second Sent.xlsx", sheet("Sheet1") firstrow clear

rename COVIDGeneralConcern w2q1
label variable w2q1 "How concerned are you that you or an immediate family member will be infected with COVID-19?"
replace w2q1="1" if w2q1=="Very unconcerned"
replace w2q1="2" if w2q1=="Somewhat unconcerned"
replace w2q1="3" if w2q1=="Neither concerned nor unconcerned"
replace w2q1="4" if w2q1=="Somewhat concerned"
replace w2q1="5" if w2q1=="Very concerned"
replace w2q1="99" if w2q1=="Unsure"

 
rename COVIDComplicationsConcern w2q2
label variable w2q2 "How concerned are you that you or an immediate family member will get serious complications and/or be hospitalized due to COVID-19?"
replace w2q2="1" if w2q2=="Very unconcerned"
replace w2q2="2" if w2q2=="Somewhat unconcerned"
replace w2q2="3" if w2q2=="Neither concerned nor unconcerned"
replace w2q2="4" if w2q2=="Somewhat concerned"
replace w2q2="5" if w2q2=="Very concerned"
replace w2q2="99" if w2q2=="Unsure"


rename LikelihoodNoSeatbelt w2q3
label variable w2q3 "Not wearing a seatbelt when being a passenger in the front seat."
replace w2q3="1" if w2q3=="Very Unlikely"
replace w2q3="2" if w2q3=="Unlikely"
replace w2q3="3" if w2q3=="Not Sure"
replace w2q3="4" if w2q3=="Likely"
replace w2q3="5" if w2q3=="Very Likely"
replace w2q3="99" if w2q3=="Prefer Not to Answer"

rename LikelihoodNoSunscreen w2q4
label variable w2q4 "Exposing yourself to the sun without using sunscreen."
replace w2q4="1" if w2q4=="Very Unlikely"
replace w2q4="2" if w2q4=="Unlikely"
replace w2q4="3" if w2q4=="Not Sure"
replace w2q4="4" if w2q4=="Likely"
replace w2q4="5" if w2q4=="Very Likely"
replace w2q4="99" if w2q4=="Prefer Not to Answer"



rename LikelihoodWhitewaterRafting w2q5
label variable w2q5 "Going whitewater rafting at high water in the spring"
replace w2q5="1" if w2q5=="Very Unlikely"
replace w2q5="2" if w2q5=="Unlikely"
replace w2q5="3" if w2q5=="Not Sure"
replace w2q5="4" if w2q5=="Likely"
replace w2q5="5" if w2q5=="Very Likely"
replace w2q5="99" if w2q5=="Prefer Not to Answer"



rename LikelihoodTravelwoReservat w2q6
label variable w2q6 "Going on a two-week vacation in a foreign country without booking accommodations ahead."
replace w2q6="1" if w2q6=="Very Unlikely"
replace w2q6="2" if w2q6=="Unlikely"
replace w2q6="3" if w2q6=="Not Sure"
replace w2q6="4" if w2q6=="Likely"
replace w2q6="5" if w2q6=="Very Likely"
replace w2q6="99" if w2q6=="Prefer Not to Answer"



rename LikelihoodPirateSoftware w2q7
label variable w2q7 "Illegally copying a piece of software."
replace w2q7="1" if w2q7=="Very Unlikely"
replace w2q7="2" if w2q7=="Unlikely"
replace w2q7="3" if w2q7=="Not Sure"
replace w2q7="4" if w2q7=="Likely"
replace w2q7="5" if w2q7=="Very Likely"
replace w2q7="99" if w2q7=="Prefer Not to Answer"



rename LikelihoodCheat w2q8
label variable w2q8 "Passing off somebody elseâ€™s work as your own."
replace w2q8="1" if w2q8=="Very Unlikely"
replace w2q8="2" if w2q8=="Unlikely"
replace w2q8="3" if w2q8=="Not Sure"
replace w2q8="4" if w2q8=="Likely"
replace w2q8="5" if w2q8=="Very Likely"
replace w2q8="99" if w2q8=="Prefer Not to Answer"



rename LikelihoodArgue w2q9
label variable w2q9 "Arguing with a friend about an issue on which he or she has a very different opinion."
replace w2q9="1" if w2q9=="Very Unlikely"
replace w2q9="2" if w2q9=="Unlikely"
replace w2q9="3" if w2q9=="Not Sure"
replace w2q9="4" if w2q9=="Likely"
replace w2q9="5" if w2q9=="Very Likely"
replace w2q9="99" if w2q9=="Prefer Not to Answer"



rename LikelihoodDefendUnpopularIs w2q10
label variable w2q10 "Defending an unpopular issue that you believe in at a social occasion."
replace w2q10="1" if w2q10=="Very Unlikely"
replace w2q10="2" if w2q10=="Unlikely"
replace w2q10="3" if w2q10=="Not Sure"
replace w2q10="4" if w2q10=="Likely"
replace w2q10="5" if w2q10=="Very Likely"
replace w2q10="99" if w2q10=="Prefer Not to Answer"


rename GASourceTrus w2q11
label variable w2q11 "I trust COVID-19-related news from official Georgia government sources, such as the Georgia Department of Public Health and the Governorâ€™s Office."
replace w2q11="1" if w2q11=="Strongly Disagree"
replace w2q11="2" if w2q11=="Somewhat Disagree"
replace w2q11="3" if w2q11=="Neither Agree Nor Disagree"
replace w2q11="4" if w2q11=="Somewhat Agree"
replace w2q11="5" if w2q11=="Strongly Agree"
replace w2q11="99" if w2q11=="Unsure"

rename ExpertSourceTrust w2q12
label variable w2q12 "I trust COVID-19-related news from official national government sources, such as the Centers for Disease Control (CDC) and the National Institutes of Health (NIH)."
replace w2q12="1" if w2q12=="Strongly Disagree"
replace w2q12="2" if w2q12=="Somewhat Disagree"
replace w2q12="3" if w2q12=="Neither Agree Nor Disagree"
replace w2q12="4" if w2q12=="Somewhat Agree"
replace w2q12="5" if w2q12=="Strongly Agree"
replace w2q12="99" if w2q12=="Unsure"

rename DontWorryifStrongImmuneSys w2q13
label variable w2q13 "People with strong immune systems do not need to worry about COVID-19."
replace w2q13="1" if w2q13=="Strongly Disagree"
replace w2q13="2" if w2q13=="Somewhat Disagree"
replace w2q13="3" if w2q13=="Neither Agree Nor Disagree"
replace w2q13="4" if w2q13=="Somewhat Agree"
replace w2q13="5" if w2q13=="Strongly Agree"
replace w2q13="99" if w2q13=="Unsure"

rename SameasFlu w2q14
label variable w2q14 "COVID-19 poses the same risk as the seasonal flu."
replace w2q14="1" if w2q14=="Strongly Disagree"
replace w2q14="2" if w2q14=="Somewhat Disagree"
replace w2q14="3" if w2q14=="Neither Agree Nor Disagree"
replace w2q14="4" if w2q14=="Somewhat Agree"
replace w2q14="5" if w2q14=="Strongly Agree"
replace w2q14="99" if w2q14=="Unsure"

rename DesiretoSociallyDistance w2q15
label variable w2q15 "During this pandemic, I wish people who are not a part of my household would stay at least six feet away from me."
replace w2q15="1" if w2q15=="Strongly Disagree"
replace w2q15="2" if w2q15=="Somewhat Disagree"
replace w2q15="3" if w2q15=="Neither Agree Nor Disagree"
replace w2q15="4" if w2q15=="Somewhat Agree"
replace w2q15="5" if w2q15=="Strongly Agree"
replace w2q15="99" if w2q15=="Unsure"

rename VaccineReaction w2q16
label variable w2q16 "Once a COVID-19 vaccine is available in the U.S., which of the following statements most closely matches what youâ€™ll do?"
replace w2q16="1" if w2q16=="I will not get the vaccine because COVID-19 is not a real danger"
replace w2q16="2" if w2q16=="I will get the vaccine eventually, but Iâ€™ll wait to make sure it is safe"
replace w2q16="3" if w2q16=="I will get the vaccine when I get around to it"
replace w2q16="4" if w2q16=="I will get the vaccine immediatelyÂ "
replace w2q16="88" if w2q16=="I will not get the vaccine because I donâ€™t think vaccines are safe in general"
replace w2q16="99" if w2q16=="Unsure"



rename FrequencyDiningOut w2q17  
label variable w2q17 "In the past month, how many times have you dined in a restaurant, bar, cafÃ©, etc?"
replace w2q17="1" if w2q17=="I have not dined out in the past month"
replace w2q17="2" if w2q17=="1 - 2 times in the past month"
replace w2q17="3" if w2q17=="3 - 6 times in the past month"
replace w2q17="4" if w2q17=="7 - 10 times in the past month"
replace w2q17="5" if w2q17=="More than 10 times in the past month"
replace w2q17="99" if w2q17=="Unsure"


rename FrequencyMask w2q18
label variable w2q18 "When out in public and around people, how often do you wear a mask or face covering?"
replace w2q18="1" if w2q18=="Never"
replace w2q18="2" if w2q18=="Rarely"
replace w2q18="3" if w2q18=="Some of the time"
replace w2q18="4" if w2q18=="Most of the time"
replace w2q18="5" if w2q18=="Always"
replace w2q18="99" if w2q18=="Unsure"

// Responses to why not wearing mask
rename WhyNoMask w2q19
label variable w2q19 "Which of the following reasons best describe why you donâ€™t regularly wear a mask or face covering? You may select up to three options."
rename WhyNoMaskOther w2q19b 
label variable w2q19b "Other text entry"

gen NoMask1W2=0
replace NoMask1W2=1 if w2q19=="Being forced to wear a mask violates my personal freedom"
gen NoMask2W2=0
replace NoMask2W2=1 if w2q19=="Masks are awkward/uncomfortable"
gen NoMask3W2=0
replace NoMask3W2=1 if w2q19=="Masks cannot protect me or stop the spread of COVID-19"
gen NoMask4W2=0
replace NoMask4W2=1 if w2q19=="There is little risk that I can contract or spread COVID-19"
gen NoMask5W2=0
replace NoMask5W2=1 if w2q19=="Wearing a mask is a greater threat to my health than COVID-19"
gen NoMaskUnsureW2=0
replace NoMaskUnsureW2=1 if w2q19=="Unsure"
gen NoMaskOtherW2=0
replace NoMaskOtherW2=1 if w2q19=="Other (please specify)"

rename FrequencySocialDistance w2q20
label variable w2q20 "When out in public and around people, how often do you socially distance by staying six or more feet away from others?"
replace w2q20="1" if w2q20=="Never"
replace w2q20="2" if w2q20=="Rarely"
replace w2q20="3" if w2q20=="Some of the time"
replace w2q20="4" if w2q20=="Most of the time"
replace w2q20="5" if w2q20=="Always"
replace w2q20="99" if w2q20=="Unsure"

// Responses to why not socially distancing
rename WhyNotSocialDistance w2q21
label variable w2q21 "Which of the following reasons best describe why you donâ€™t regularly socially distance by staying six or more feet away from others?' You may select up to three options."
rename WhyNotSocialDistanceOther w2q21b
label variable w2q21b "Other text entry" 

gen SocDis1W2=0
replace SocDis1W2=1 if w2q21=="Being forced to socially distance violates my personal freedom"
gen SocDis2W2=0
replace SocDis2W2=1 if w2q21=="Socially distancing cannot protect me or stop the spread of COVID-19"
gen SocDis3W2=0
replace SocDis3W2=1 if w2q21=="Socially distancing is awkward/uncomfortable"
gen SocDis4W2=0
replace SocDis4W2=1 if w2q21=="There is little risk that I can contract or spread COVID-19"
gen SocDisUnsureW2=0
replace SocDisUnsureW2=1 if w2q21=="Unsure"
gen SocDisOtherW2=0
replace SocDisOtherW2=1 if w2q21=="Other (please specify)"

rename FrequencyEncourageMaskSoc w2q22
label variable w2q22 "How often do you ask or encourage your family or friends to wear a mask and/or stay six feet away from others for their own safety?"
replace w2q22="1" if w2q22=="Never"
replace w2q22="2" if w2q22=="Rarely"
replace w2q22="3" if w2q22=="Some of the time"
replace w2q22="4" if w2q22=="Most of the time"
replace w2q22="5" if w2q22=="Always"
replace w2q22="99" if w2q22=="Unsure"

rename HowManyinMasksSocialDista w2q23
label variable w2q23 "Generally, when you are in public how many of the people around you are wearing masks and/or social distancing by staying at least six feet away from others?"
replace w2q23="1" if w2q23=="Practically no one "
replace w2q23="2" if w2q23=="Some people, but less than half"
replace w2q23="3" if w2q23=="Not everyone, but more than half"
replace w2q23="4" if w2q23=="Practically everyone"
replace w2q23="88" if w2q23=="I never go out"
replace w2q23="99" if w2q23=="Unsure"

rename ShoppingChange w2q24
label variable w2q24 "Which of the following statements most closely reflects how your shopping habits have changed due to COVID-19, if at all?"
replace w2q24="1" if w2q24=="I go to the store less often"
replace w2q24="2" if w2q24=="My shopping habits haven’t changed – I go to the store the same amount"
replace w2q24="3" if w2q24=="I go to the store more often"
replace w2q24="99" if w2q24=="Unsure"

rename VideoImpact w2q25  // Attention check -- No incorrect answers, and thus excluded
label variable w2q25 "What information do you recall from the video?"

rename Ideology w2q28
label variable w2q28 "And thinking about your views toward politics and government, would you say you areâ€¦"
replace w2q28="1" if w2q28=="Very liberal"
replace w2q28="2" if w2q28=="Liberal"
replace w2q28="3" if w2q28=="Moderate"
replace w2q28="4" if w2q28=="Somewhat conservative"
replace w2q28="5" if w2q28=="Very conservative"
replace w2q28="99" if w2q28=="Unsure"

rename InformedCOVIDThreat17 w2q30
label variable w2q30 "On a scale of 1 - 7, with 1 being an insignificant risk, and 7 being a serious risk, how much of a health risk is COVID-19 to you, or someone close to you?"
replace w2q30="0" if w2q30=="COVID-19 is not a health threat in general"
replace w2q30="99" if w2q30=="Unsure"

rename FamilyFriendCOVIDDiagnosis w2q31
label variable w2q31 "Do you believe you or someone in your household, a friend, or a coworker has been infected with COVID-19 at any time?"
replace w2q31="1" if w2q31=="No, I do not believe myself or an immediate family member has had COVID-19"
replace w2q31="2" if w2q31=="Yes, the symptoms were consistent with the virus but not confirmed by a test"
replace w2q31="3" if w2q31=="Yes, a medical test confirmed COVID-19"
replace w2q31="99" if w2q31=="Unsure"

gen test="."
replace test="0" if Mode=="Control"
replace test="1" if Mode=="Test"

rename Minutes minutes2

gen exclude2=0
replace exclude2=1 if Mode=="Control" & minutes2<2 // 3 respondents
replace exclude2=1 if Mode=="Test" & minutes2<5 // 16 respondents

gen wave=2

destring _all, replace
save "~\Desktop\Projects\COVID\Analysis\Wave 2 Prelim Data Final.dta", replace


import excel "~\Desktop\Projects\COVID\Analysis\Wave 3.xlsx", sheet("Sheet1") firstrow clear

rename COVIDGeneralConcern w3q1

label variable w3q1 "How concerned are you that you or an immediate family member will be infected with COVID-19?"
replace w3q1="1" if w3q1=="Very unconcerned"
replace w3q1="2" if w3q1=="Somewhat unconcerned"
replace w3q1="3" if w3q1=="Neither concerned nor unconcerned"
replace w3q1="4" if w3q1=="Somewhat concerned"
replace w3q1="5" if w3q1=="Very concerned"
replace w3q1="99" if w3q1=="Unsure"

rename COVIDComplicationsConcern w3q2

label variable w3q2 "How concerned are you that you or an immediate family member will get serious complications and/or be hospitalized due to COVID-19?"
replace w3q2="1" if w3q2=="Very unconcerned"
replace w3q2="2" if w3q2=="Somewhat unconcerned"
replace w3q2="3" if w3q2=="Neither concerned nor unconcerned"
replace w3q2="4" if w3q2=="Somewhat concerned"
replace w3q2="5" if w3q2=="Very concerned"
replace w3q2="99" if w3q2=="Unsure"

rename PeopleCanbeTrusted w3q3
label variable w3q3 "would you say that most people can be trusted, or that you canâ€™t be too careful in dealing with people?"
replace w3q3="2" if w3q3=="Depends"
replace w3q3="3" if w3q3=="Most people can be trusted"
replace w3q3="99" if w3q3=="Unsure"
replace w3q3="1" if w3q3!="2" & w3q3!="3" & w3q3!="99" 


rename PeopleTrytobeFair w3q4
label variable w3q4 "Do you think that most people would try to take advantage of you if they got a chance, or would they try to be fair?"
replace w3q4="1" if w3q4=="Would take advantage"
replace w3q4="2" if w3q4=="Depends"
replace w3q4="3" if w3q4=="Would try to be fair"
replace w3q4="99" if w3q4=="Unsure" 


rename PeopleareHelpful w3q5
label variable w3q4 "Would you say that most of the time people try to be helpful, or are they mostly looking out for themselves?"
replace w3q5="1" if w3q5=="Just look out for themselves"
replace w3q5="2" if w3q5=="Depends"
replace w3q5="3" if w3q5=="Try to be helpful"
replace w3q5="99" if w3q5=="Unsure"



rename DontWorryifStrongImmuneSys w3q6
label variable w3q6 "People with strong immune systems do not need to worry about COVID-19."
replace w3q6="1" if w3q6=="Strongly disagree"
replace w3q6="2" if w3q6=="Somewhat disagree"
replace w3q6="3" if w3q6=="Neither agree nor disagree"
replace w3q6="4" if w3q6=="Somewhat agree"
replace w3q6="5" if w3q6=="Strongly agree"
replace w3q6="99" if w3q6=="Unsure"

rename SameasFlu w3q7
label variable w3q7 "COVID-19 poses the same risk as the seasonal flu."
replace w3q7="1" if w3q7=="Strongly disagree"
replace w3q7="2" if w3q7=="Somewhat disagree"
replace w3q7="3" if w3q7=="Neither agree nor disagree"
replace w3q7="4" if w3q7=="Somewhat agree"
replace w3q7="5" if w3q7=="Strongly agree"
replace w3q7="99" if w3q7=="Unsure"

rename COVIDVaccine w3q8
label variable w3q8 "There will be a widely available vaccine for COVID-19 by the end of the year."
replace w3q8="1" if w3q8=="Strongly disagree"
replace w3q8="2" if w3q8=="Somewhat disagree"
replace w3q8="3" if w3q8=="Neither agree nor disagree"
replace w3q8="4" if w3q8=="Somewhat agree"
replace w3q8="5" if w3q8=="Strongly agree"
replace w3q8="99" if w3q8=="Unsure"

rename DesiretoSociallyDistance w3q9
label variable w3q9 "During this pandemic, I wish people who are not a part of my household would stay at least six feet away from me."
replace w3q9="1" if w3q9=="Strongly disagree"
replace w3q9="2" if w3q9=="Somewhat disagree"
replace w3q9="3" if w3q9=="Neither agree nor disagree"
replace w3q9="4" if w3q9=="Somewhat agree"
replace w3q9="5" if w3q9=="Strongly agree"
replace w3q9="99" if w3q9=="Unsure"

rename VaccineReaction w3q10
label variable w3q10 "Once a COVID-19 vaccine is available in the U.S., which of the following statements most closely matches what youâ€™ll do?"
replace w3q10="1" if w3q10=="I will not get the vaccine because COVID-19 is not a real danger"
replace w3q10="2" if w3q10=="I will get the vaccine eventually, but Iâ€™ll wait to make sure it is safe"
replace w3q10="3" if w3q10=="I will get the vaccine when I get around to it"
replace w3q10="4" if w3q10=="I will get the vaccine immediatelyÂ "
replace w3q10="88" if w3q10=="I will not get the vaccine because I donâ€™t think vaccines are safe in general"
replace w3q10="99" if w3q10=="Unsure"

rename FrequencyLargeGroupEvent w3q11
label variable w3q11 "In the past month, how many times have you attended a group event with more than 10 people in attendance, such as a religious gathering, party, funeral, wedding, sporting event, etc.?"
replace w3q11="1" if w3q11=="I have not attended a group event with more than 10 people in attendance in the past two weeks"
replace w3q11="2" if w3q11=="1 - 2 times in the past two weeks"
replace w3q11="3" if w3q11=="3 - 4 times in the past two weeks"
replace w3q11="4" if w3q11=="More than 5 times in the past two weeks"
replace w3q11="99" if w3q11=="Unsure"

rename FrequencyDiningOut w3q12
label variable w3q12 "In the past two weeks, how many times have you dined in a restaurant, bar, cafÃ©, etc?"
replace w3q12="1" if w3q12=="I have not dined out in the past two weeks"
replace w3q12="2" if w3q12=="1 - 2 times in the past two weeks"
replace w3q12="3" if w3q12=="3 - 4 times in the past two weeks"
replace w3q12="4" if w3q12=="More than 5 times in the past two weeks"
replace w3q12="99" if w3q12=="Unsure"


rename FrequencyMask w3q13
label variable w3q13 "When out in public and around people, how often do you wear a mask or face covering?"
replace w3q13="1" if w3q13=="Never"
replace w3q13="2" if w3q13=="Rarely"
replace w3q13="3" if w3q13=="Some of the time"
replace w3q13="4" if w3q13=="Most of the time"
replace w3q13="5" if w3q13=="Always"
replace w3q13="99" if w3q13=="Unsure"


rename WhyNoMask w3q14
label variable w3q14 "Which of the following reasons best describe why you donâ€™t regularly wear a mask or face covering? You may select up to three options."

gen NoMask1W3=0
replace NoMask1W3=1 if w3q14=="Being forced to wear a mask violates my personal freedom"
gen NoMask2W3=0
replace NoMask2W3=1 if w3q14=="Masks are awkward/uncomfortable"
gen NoMask3W3=0
replace NoMask3W3=1 if w3q14=="Masks cannot protect me or stop the spread of COVID-19"
gen NoMask4W3=0
replace NoMask4W3=1 if w3q14=="There is little risk that I can contract or spread COVID-19"
gen NoMask5W3=0
replace NoMask5W3=1 if w3q14=="Wearing a mask is a greater threat to my health than COVID-19"
gen NoMaskUnsureW3=0
replace NoMaskUnsureW3=1 if w3q14=="Unsure"
gen NoMaskOtherW3=0
replace NoMaskOtherW3=1 if w3q14=="Other (please specify)"

rename WhyNoMaskOther w3q14b
label variable w3q14b "Other text entry"

rename FrequencySocialDistance w3q15
label variable w3q15 "When out in public and around people, how often do you socially distance by staying six or more feet away from others?"
replace w3q15="1" if w3q15=="Never"
replace w3q15="2" if w3q15=="Rarely"
replace w3q15="3" if w3q15=="Some of the time"
replace w3q15="4" if w3q15=="Most of the time"
replace w3q15="5" if w3q15=="Always"
replace w3q15="99" if w3q15=="Unsure"

rename WhyNotSocialDistance w3q16
label variable w3q16 "Which of the following reasons best describe why you donâ€™t regularly socially distance by staying six or more feet away from others?' You may select up to three options."

gen SocDis1W3=0
replace SocDis1W3=1 if w3q16=="Being forced to socially distance violates my personal freedom"
gen SocDis2W3=0
replace SocDis2W3=1 if w3q16=="Socially distancing cannot protect me or stop the spread of COVID-19"
gen SocDis3W3=0
replace SocDis3W3=1 if w3q16=="Socially distancing is awkward/uncomfortable"
gen SocDis4W3=0
replace SocDis4W3=1 if w3q16=="There is little risk that I can contract or spread COVID-19"
gen SocDisUnsureW3=0
replace SocDisUnsureW3=1 if w3q16=="Unsure"
gen SocDisOtherW3=0
replace SocDisOtherW3=1 if w3q16=="Other (please specify)"


rename WhyNotSocialDistanceOther w3q16b

rename FrequencyEncourageMaskSoc w3q17
label variable w3q17 "How often do you ask or encourage your family or friends to wear a mask and/or stay six feet away from others for their own safety?"
replace w3q17="1" if w3q17=="Never"
replace w3q17="2" if w3q17=="Rarely"
replace w3q17="3" if w3q17=="Some of the time"
replace w3q17="4" if w3q17=="Most of the time"
replace w3q17="5" if w3q17=="Always"
replace w3q17="99" if w3q17=="Unsure"

rename HowManyinMasksSocialDista w3q18
label variable w3q18 "Generally, when you are in public how many of the people around you are wearing masks and/or social distancing by staying at least six feet away from others?"
replace w3q18="1" if w3q18=="Practically no one "
replace w3q18="2" if w3q18=="Some people, but less than half"
replace w3q18="3" if w3q18=="Not everyone, but more than half"
replace w3q18="4" if w3q18=="Practically everyone"
replace w3q18="88" if w3q18=="I never go out"
replace w3q18="99" if w3q18=="Unsure"

rename GovMurdersCitizens w3q19
label variable w3q19 "The government is involved in the murder of innocent citizens and/or well-known public figures, and keeps this a secret."
replace w3q19="1" if w3q19=="Definitely not true"
replace w3q19="2" if w3q19=="Probably not true"
replace w3q19="3" if w3q19=="Not sure/cannot decide"
replace w3q19="4" if w3q19=="Probably true"
replace w3q19="5" if w3q19=="Definitely true"
replace w3q19="99" if w3q19=="Unsure"

rename Illuminati w3q20
label variable w3q20 "The power held by heads of state is second to that of small unknown groups who really control world politics."
replace w3q20="1" if w3q20=="Definitely not true"
replace w3q20="2" if w3q20=="Probably not true"
replace w3q20="3" if w3q20=="Not sure/cannot decide"
replace w3q20="4" if w3q20=="Probably true"
replace w3q20="5" if w3q20=="Definitely true"
replace w3q20="99" if w3q20=="Unsure"

rename ScientistsLie w3q21
label variable w3q21 "Groups of scientists manipulate, fabricate, or suppress evidence in order to deceive the public."
replace w3q21="1" if w3q21=="Definitely not true"
replace w3q21="2" if w3q21=="Probably not true"
replace w3q21="3" if w3q21=="Not sure/cannot decide"
replace w3q21="4" if w3q21=="Probably true"
replace w3q21="5" if w3q21=="Definitely true"
replace w3q21="99" if w3q21=="Unsure"

rename SecretGovTerrorismWithinUS w3q22
label variable w3q22 "The government permits or perpetrates acts of terrorism on its own soil, disguising its involvement."
replace w3q22="1" if w3q22=="Definitely not true"
replace w3q22="2" if w3q22=="Probably not true"
replace w3q22="3" if w3q22=="Not sure/cannot decide"
replace w3q22="4" if w3q22=="Probably true"
replace w3q22="5" if w3q22=="Definitely true"
replace w3q22="99" if w3q22=="Unsure"

rename GovHidingProofofAliens w3q23
label variable w3q23 "Evidence of alien contact is being concealed from the public."
replace w3q23="1" if w3q23=="Definitely not true"
replace w3q23="2" if w3q23=="Probably not true"
replace w3q23="3" if w3q23=="Not sure/cannot decide"
replace w3q23="4" if w3q23=="Probably true"
replace w3q23="5" if w3q23=="Definitely true"
replace w3q23="99" if w3q23=="Unsure"

rename SuppressedTech w3q24
label variable w3q24 "New and advanced technology which would harm current industry is being suppressed."
replace w3q24="1" if w3q24=="Definitely not true"
replace w3q24="2" if w3q24=="Probably not true"
replace w3q24="3" if w3q24=="Not sure/cannot decide"
replace w3q24="4" if w3q24=="Probably true"
replace w3q24="5" if w3q24=="Definitely true"
replace w3q24="99" if w3q24=="Unsure"

rename GovUsesPatsies w3q25
label variable w3q25 "The government uses people as patsies to hide its involvement in criminal activity."
replace w3q25="1" if w3q25=="Definitely not true"
replace w3q25="2" if w3q25=="Probably not true"
replace w3q25="3" if w3q25=="Not sure/cannot decide"
replace w3q25="4" if w3q25=="Probably true"
replace w3q25="5" if w3q25=="Definitely true"
replace w3q25="99" if w3q25=="Unsure"

rename PoliticiansHideImportantInfo w3q26
label variable w3q26 "A lot of important information is deliberately concealed from the public out of self-interest."
replace w3q26="1" if w3q26=="Definitely not true"
replace w3q26="2" if w3q26=="Probably not true"
replace w3q26="3" if w3q26=="Not sure/cannot decide"
replace w3q26="4" if w3q26=="Probably true"
replace w3q26="5" if w3q26=="Definitely true"
replace w3q26="99" if w3q26=="Unsure"

rename InformedCOVIDThreat17 w3q27
label variable w3q27 "On a scale of 1 - 7, with 1 being an insignificant risk, and 7 being a serious risk, how much of a health risk is COVID-19 to you, or someone close to you?"
replace w3q27="0" if w3q27=="COVID-19 is not a health threat in general"
replace w3q27="99" if w3q27=="Unsure"

rename FamilyFriendCOVIDDiagnosis w3q31
label variable w3q31 "Do you believe you or someone in your household, a friend, or a coworker has been infected with COVID-19 at any time?"
replace w3q31="1" if w3q31=="No, I do not believe myself or an immediate family member has had COVID-19"
replace w3q31="2" if w3q31=="Yes, the symptoms were consistent with the virus but not confirmed by a test"
replace w3q31="3" if w3q31=="Yes, a medical test confirmed COVID-19"
replace w3q31="99" if w3q31=="Unsure"


rename Gender female
replace female="1" if female=="Female"
replace female="0" if female=="Male"
replace female="99" if female=="Other"

rename AgeRange age
replace age="1" if age=="18 - 34"
replace age="2" if age=="35 - 49"
replace age="3" if age=="50 - 64"
replace age="4" if age=="65 or older"

rename IncomebyResponse income4cat
replace income4cat="2" if income4cat=="$25,000 - $50,000"
replace income4cat="3" if income4cat=="$50,001 - $100,000"
replace income4cat="1" if income4cat=="Less than $25,000"
replace income4cat="4" if income4cat=="More than $100,000"

gen test="."
replace test="0" if Group=="Control"
replace test="1" if Group=="Test"

rename Minutes minutes3

gen exclude3=0
replace exclude3=1 if Group=="Control" & minutes3<2 // 1 respondent 
replace exclude3=1 if Group=="Test" & minutes3<2 // 0 respondents 

gen wave=3	
	
destring _all, replace

save "~\Desktop\Projects\COVID\Analysis\Wave 3 Prelim Data Final.dta", replace





use "~\Desktop\Projects\COVID\Analysis\Wave 1 Prelim Data Final.dta", clear
merge m:m UID using "~\Desktop\Projects\COVID\Analysis\Wave 2 Prelim Data Final.dta"
rename _merge merge1
merge m:m UID using "~\Desktop\Projects\COVID\Analysis\Wave 3 Prelim Data Final.dta"
rename _merge merge2

drop if exclude1==1 // 47 observations dropped
drop if exclude2==2 // 0 observations dropped
drop if exclude3==3 // 0 observations dropped

save "~\Desktop\Projects\COVID\Analysis\Prelim Cleaned Data Final.dta", replace
use "~\Desktop\Projects\COVID\Analysis\Prelim Cleaned Data Final.dta", clear


// 3 Batteries
replace w2q3=. if w2q3==99 
replace w2q4=. if w2q4==99 
replace w2q5=.  if w2q5==99 
replace w2q6=.  if w2q6==99 
replace w2q7=.  if w2q7==99 
replace w2q8=.  if w2q8==99
replace w2q9=.  if w2q9==99 
replace w2q10=.  if w2q10==99
replace w3q3=.  if w3q3==99
replace w3q4=.  if w3q4==99
replace w3q5=.  if w3q5==99
replace w3q19=.  if w3q19==99
replace w3q20=.  if w3q20==99
replace w3q21=.  if w3q21==99
replace w3q22=.  if w3q22==99
replace w3q23=.  if w3q23==99
replace w3q24=.  if w3q24==99
replace w3q25=.  if w3q25==99
replace w3q26=.  if w3q26==99 


replace w2q3=(6 - w2q3) 
replace w2q4=(6 - w2q4) 
replace w2q5=(6 - w2q5)
replace w2q6=(6 - w2q6) 
replace w2q7=(6 - w2q7) 
replace w2q8=(6 - w2q8) 
replace w2q9=(6 - w2q9) 
replace w2q10=(6 - w2q10)




gen riskaverse=((w2q3+w2q4+w2q5+w2q6+w2q7+w2q8+w2q9+w2q10)/8)
label variable riskaverse "Risk Aversion Battery"
gen soctrust=((w3q3+w3q4+w3q5)/3) 
label variable soctrust "Social Trust Battery"
gen conspir=((w3q19+w3q20+w3q21+w3q22+w3q23+w3q24+w3q25+w3q26)/8) 
label variable conspir "Conspiratorial Thinking Battery"


// Behavior Measure


// Non responses 

replace w1q12=. if w1q12==99
replace w1q14=. if w1q14==99
replace w1q16=. if w1q16==99
replace w2q18=. if w2q18==99
replace w2q20=. if w2q20==99
replace w2q22=. if w2q22==99
replace w3q13=. if w3q13==99
replace w3q15=. if w3q15==99
replace w3q17=. if w3q17==99  


corr w1q12 w1q14 w1q16 // below 0.7
factor w1q12 w1q14 w1q16, factors(1)
rotate
predict f1
corr w1q12 w1q14 w1q16 f1 
rename f1 behaveW1

corr w2q18 w2q20 w2q22  // again below 0.7
factor w2q18 w2q20 w2q22, factors(1)
rotate 
predict f2
corr  w2q18 w2q20 w2q22 f2 
rename f2 behaveW2

corr w3q13 w3q15 w3q17 // again below 0.7
factor w3q13 w3q15 w3q17 , factors(1)
rotate
predict f3
corr w3q13 w3q15 w3q17 f3 
rename f3 behaveW3



// KAP Measure

// We want all measures in the pro social direction - agreement with the immune and flu questions needs to be inverted


replace w1q6=(6-w1q6) if w1q6!=99
replace w1q7=(6-w1q7) if w1q7!=99

replace w2q13=(6-w2q13) if w2q13!=99
replace w2q14=(6-w2q14) if w2q14!=99

replace w3q6=(6-w3q6) if w3q6!=99
replace w3q7=(6-w3q7) if w3q7!=99

// Non responses 

replace w1q6=. if w1q6==99
replace w1q7=. if w1q7==99
replace w1q9=. if w1q9==99
replace w2q13=. if w2q13==99
replace w2q14=. if w2q14==99
replace w2q15=. if w2q15==99
replace w3q6=. if w3q6==99
replace w3q7=. if w3q7==99
replace w3q9=. if w3q9==99  

destring w1q10, replace
corr w1q4 w1q6 w1q7 w1q9 w1q10 if w1q4!=99 & w1q10!=88 & w1q10!=99 // below 0.7
factor w1q4 w1q6 w1q7 w1q9 w1q10 if w1q4!=99 & w1q10!=88 & w1q10!=99, factors(1)
rotate
predict x1
corr x1 w1q4 w1q6 w1q7 w1q9 w1q10 if w1q4!=99 & w1q10!=99 // w1q10 (questions regarding vaccine behavior) appears to be capturing something else, as does w1q4
drop x1

corr w1q6 w1q7 w1q9 // Below 0.7
factor w1q6 w1q7 w1q9, factors(1)
rotate 
predict x1
corr x1 w1q6 w1q7 w1q9 // Lowest correlation = 0.78
rename x1 kapW1

corr w2q13 w2q14 w2q15 // Below 0.7
factor w2q13 w2q14 w2q15, factors(1)
rotate
predict x2
corr w2q13 w2q14 w2q15 x2 // lowest correlation = 0.79
rename x2 kapW2



corr w3q6 w3q7 w3q9 // Below 0.7
factor w3q6 w3q7 w3q9, factors(1)
rotate
predict x3
corr w3q6 w3q7 w3q9 x3 // lowest correlation = 0.737
rename x3 kapW3


label variable kapW1 "Predicted latent COVID KAP factor: Wave 1"
label variable kapW2 "Predicted latent COVID KAP factor: Wave 2"
label variable kapW3 "Predicted latent COVID KAP factor: Wave 3"
label variable behaveW1 "Predicted latent COVID behavior factor: Wave 1"
label variable behaveW2 "Predicted latent COVID behavior factor: Wave 2"
label variable behaveW3 "Predicted latent COVID behavior factor: Wave 3"

// Deltas

gen kapChangeW1W2=kapW2-kapW1
gen kapChangeW2W3=kapW3-kapW2
gen kapChangeW1W3=kapW3-kapW1

gen behaveChangeW1W2=behaveW2-behaveW1
gen behaveChangeW2W3=behaveW3-behaveW2
gen behaveChangeW1W3=behaveW3-behaveW1

sum kapW1 kapW2 kapW3 behaveW1 behaveW2 behaveW3 kapChangeW1W2 kapChangeW2W3 kapChangeW1W3 behaveChangeW1W2 behaveChangeW2W3 behaveChangeW1W3

// Institutional Trust 

replace w2q11=. if w2q11==99
replace w2q12=. if w2q12==99 // 1 observation dropped

corr w2q11 w2q12 // Correlation=0.44
factor w2q11 w2q12, factors(1)
rotate 
predict f4 // Eigenvalue below 1, revert to individual measures
drop f4

rename w2q11 instiTrustGeorgia
rename w2q12 instiTrustNational

// Social Norm

replace w1q17=. if w1q17==88
replace w2q23=. if w2q23==88
replace w3q18=. if w3q18==88
replace w1q17=. if w1q17==99
replace w2q23=. if w2q23==99
replace w3q18=. if w3q18==99 // 9 observations dropped

rename w1q17 normW1
rename w2q23 normW2
rename w3q18 normW3
gen normW1W2=normW1-normW2
gen normW2W3=normW2-normW3
gen normW1W3=normW1-normW3


// Right wing news

gen RWnews=0
label variable RWnews "Relies on Right Wing news sources"
replace RWnews=1 if NewsSource4==1 
replace RWnews=1 if NewsSource5==1
replace RWnews=0 if NewsSource2==1
replace RWnews=0 if NewsSource3==1
replace RWnews=0 if NewsSourceOther=="NPR" | NewsSourceOther=="npr" | NewsSourceOther=="Npr" 
replace RWnews=1 if NewsSourceOther=="Oann"
replace RWnews=1 if NewsSourceOther=="Newsmax"
replace RWnews=1 if UID=="LALGA148649813"
replace RWnews=1 if UID=="LALGA148774580"
replace RWnews=1 if UID=="LALGA149323948"
replace RWnews=1 if UID=="LALGA149492873"
replace RWnews=1 if UID=="LALGA503865458"






// We can say with confidence that FOX and talk radio are right wing sources; the rest not so much
// Not clear what people are viewing on Facebook Twitter etc.

// Attention to News
rename w1q25 newsAttention
replace newsAttention=. if newsAttention==99  //1 observation dropped 

//Basic Threat Response
replace w1q28=. if w1q28==99 
replace w2q30=. if w2q30==99 
replace w3q27=. if w3q27==99 // 2 observations dropped

rename w1q28 covidThreatW1
rename w2q30 covidThreatW2
rename w3q27 covidThreatW3
gen ThreatW1W2=covidThreatW1-covidThreatW2
gen ThreatW2W3=covidThreatW2-covidThreatW3
gen ThreatW1W3=covidThreatW1-covidThreatW3



gen NoPersonalExperienceW1=.
replace NoPersonalExperienceW1=1 if w1q29==1
replace NoPersonalExperienceW1=0 if w1q29==2 | w1q29==3


gen NoPersonalExperienceW2=.
replace NoPersonalExperienceW2=1 if w2q31==1
replace NoPersonalExperienceW2=0 if w2q31==2 | w2q31==3


gen NoPersonalExperienceW3=.
replace NoPersonalExperienceW3=1 if w3q31==1
replace NoPersonalExperienceW3=0 if w3q31==2 | w3q31==3

gen NoPersonalExperienceW12=.
replace NoPersonalExperienceW12=1 if w1q29==1 & w2q31==1
replace NoPersonalExperienceW12=0 if w1q29==2 | w1q29==3 | w2q31==2 | w2q31==3


gen NoPersonalExperienceW23=.
replace NoPersonalExperienceW23=1 if w2q31==1 & w3q31==1
replace NoPersonalExperienceW23=0 if w2q31==2 | w2q31==3 | w3q31==2 | w3q31==3


gen NoPersonalExperienceAny=.
replace NoPersonalExperienceAny=1 if NoPersonalExperienceW1==1 & NoPersonalExperienceW2==1 & NoPersonalExperienceW3==1
replace NoPersonalExperienceAny=0 if NoPersonalExperienceW1==0 | NoPersonalExperienceW2==0 | NoPersonalExperienceW3==0


gen qualityExclude=0
replace qualityExclude=1 if w1q29==3 & (w2q31<=2 | w3q31<=2)
replace qualityExclude=1 if w2q31==3 & w3q31<=2

gen RWandTest=0
replace RWandTest=1 if RWnews==1 & test==1

save "~\Desktop\Projects\COVID\Analysis\Cleaned Data Final.dta", replace


gen knowledge1=((w1q6+w1q7)/2)   // alpha 0.6275
gen knowledge2=((w2q13+w2q14)/2) // alpha 0.5376
gen knowledge3=((w3q6+w3q7)/2) // alpha 0.5859

gen knowledgeW12=knowledge2-knowledge1
gen knowledgeW23=knowledge3-knowledge2
gen knowledgeW13=knowledge3-knowledge1

replace w1q4=. if w1q4==99
gen perception1=w1q4
replace w2q2=. if w2q2==99
gen perception2=w2q2
gen perception3=w3q2

gen perceptionW12=perception2-perception1
gen perceptionW23=perception3-perception2
gen perceptionW13=perception3-perception1

gen attitude1=w1q9
gen attitude2=w2q15
gen attitude3=w3q9

gen attitudeW12=attitude2-attitude1
gen attitudeW23=attitude3-attitude2
gen attitudeW13=attitude3-attitude1

gen norm1=normW1
gen norm2=normW2
gen norm3=normW3

gen normW12=norm2-norm1
gen normW23=norm3-norm2
gen normW13=norm3-norm1

gen masking1=w1q12
gen masking2=w2q18
gen masking3=w3q13

gen maskingW12=masking2-masking1
gen maskingW23=masking3-masking2
gen maskingW13=masking3-masking1


gen distance1=w1q14
gen distance2=w2q20
gen distance3=w3q15

gen distanceW12=distance2-distance1
gen distanceW23=distance3-distance2
gen distanceW13=distance3-distance1


gen encourage1=w1q16
gen encourage2=w2q22
gen encourage3=w3q17

gen encourageW12=encourage2-encourage1
gen encourageW23=encourage3-encourage2
gen encourageW13=encourage3-encourage1


replace w2q1=. if w2q1==99
gen concern2=w2q1
gen concern3=w3q1
gen concernW23=concern3-concern2


factor w1q6 w1q7 w1q4 w1q9, factors(1)
rotate
predict fKAP1
corr fKAP1 w1q6 w1q7 w1q4 w1q9 // All above 0.6974

factor w2q13 w2q14 w2q2 w2q9, factors(1)
rotate
predict fKAP2
corr fKAP2 w2q13 w2q14 w2q2 w2q15 // All above 0.5937

factor w3q6 w3q7 w3q2 w3q9 , factors(1)
rotate
predict fKAP3
corr fKAP3 w3q6 w3q7 w3q2 w3q9 // All above 0.5539

gen fKAPW12=fKAP2-fKAP1
gen fKAPW23=fKAP3-fKAP2
gen fKAPW13=fKAP3-fKAP1

corr masking1 distance1 encourage1
factor masking1 distance1 encourage1, factors(1)
rotate
predict fBehave1
corr fBehave1 masking1 distance1 encourage1 // All above 0.8233


factor masking2 distance2 encourage2, factors(1)
rotate
predict fBehave2
corr fBehave2 masking2 distance2 encourage2 // All above 0.8335


factor masking3 distance3 encourage3, factors(1)
rotate
predict fBehave3
corr fBehave3 masking3 distance3 encourage3 // All above 0.7765

gen fBehaveW12=fBehave2-fBehave1
gen fBehaveW23=fBehave3-fBehave2
gen fBehaveW13=fBehave3-fBehave1

replace w1q11=. if w1q11==99
replace w3q11=. if w3q11==99

replace w1q18=. if w1q18==99
replace w2q24=. if w2q24==99

replace w2q17=. if w2q17==99
replace w3q12=. if w3q12==99

gen groupEvent1=w1q11
gen groupEvent3=w3q11

gen shopping1=w1q18
gen shopping2=w2q24

gen dining2=w2q17
gen dining3=w3q12

gen groupEventW13=groupEvent3-groupEvent1
gen shoppingW12=shopping2-shopping1
gen diningW23=dining3-dining2

// Duplicates
tab UID
drop if UID=="LALGA148731068" | UID=="LALGA148287744" | UID=="LALGA147899063" | UID=="LALGA147784548" // 8 observations (4 respondents)

drop if qualityExclude==1 // 36 observations 

save "~\Desktop\Projects\COVID\Analysis\Final Cleaned Experimental Data.dta", replace
use "~\Desktop\Projects\COVID\Analysis\Final Cleaned Experimental Data.dta", clear

/* Exclusions:

First Wave N=920

Time exclusion: 47 
Personal experience conflicting answers: 36
Post exposure validity check: 0 respondents
missing data and duplicates: 13+4 
